.class public Lorg/com/cctest/view/SlideSwitch;
.super Landroid/view/View;
.source "SlideSwitch.java"


# annotations
.annotation system Ldalvik/annotation/MemberClasses;
    value = {
        Lorg/com/cctest/view/SlideSwitch$SlideListener;
    }
.end annotation


# static fields
.field private static final COLOR_THEME:I

.field private static final RIM_SIZE:I = 0x3

.field public static final SHAPE_CIRCLE:I = 0x2

.field public static final SHAPE_RECT:I = 0x1


# instance fields
.field private alpha:I

.field private backRect:Landroid/graphics/Rect;

.field private color_theme:I

.field private diffX:I

.field private eventLastX:I

.field private eventStartX:I

.field private frontRect:Landroid/graphics/Rect;

.field private frontRect_left:I

.field private frontRect_left_begin:I

.field private isOpen:Z

.field private listener:Lorg/com/cctest/view/SlideSwitch$SlideListener;

.field private max_left:I

.field private min_left:I

.field private paint:Landroid/graphics/Paint;

.field private shape:I


# direct methods
.method static constructor <clinit>()V
    .locals 1

    .prologue
    .line 25
    const-string v0, "#ff00ee00"

    invoke-static {v0}, Landroid/graphics/Color;->parseColor(Ljava/lang/String;)I

    move-result v0

    sput v0, Lorg/com/cctest/view/SlideSwitch;->COLOR_THEME:I

    return-void
.end method

.method public constructor <init>(Landroid/content/Context;)V
    .locals 1
    .param p1, "context"    # Landroid/content/Context;

    .prologue
    .line 70
    const/4 v0, 0x0

    invoke-direct {p0, p1, v0}, Lorg/com/cctest/view/SlideSwitch;-><init>(Landroid/content/Context;Landroid/util/AttributeSet;)V

    .line 71
    return-void
.end method

.method public constructor <init>(Landroid/content/Context;Landroid/util/AttributeSet;)V
    .locals 1
    .param p1, "context"    # Landroid/content/Context;
    .param p2, "attrs"    # Landroid/util/AttributeSet;

    .prologue
    .line 66
    const/4 v0, 0x0

    invoke-direct {p0, p1, p2, v0}, Lorg/com/cctest/view/SlideSwitch;-><init>(Landroid/content/Context;Landroid/util/AttributeSet;I)V

    .line 67
    return-void
.end method

.method public constructor <init>(Landroid/content/Context;Landroid/util/AttributeSet;I)V
    .locals 5
    .param p1, "context"    # Landroid/content/Context;
    .param p2, "attrs"    # Landroid/util/AttributeSet;
    .param p3, "defStyleAttr"    # I

    .prologue
    const/4 v4, 0x3

    const/4 v3, 0x1

    const/4 v2, 0x0

    .line 52
    invoke-direct {p0, p1, p2, p3}, Landroid/view/View;-><init>(Landroid/content/Context;Landroid/util/AttributeSet;I)V

    .line 38
    iput v4, p0, Lorg/com/cctest/view/SlideSwitch;->frontRect_left_begin:I

    .line 41
    iput v2, p0, Lorg/com/cctest/view/SlideSwitch;->diffX:I

    .line 53
    const/4 v1, 0x0

    iput-object v1, p0, Lorg/com/cctest/view/SlideSwitch;->listener:Lorg/com/cctest/view/SlideSwitch$SlideListener;

    .line 54
    new-instance v1, Landroid/graphics/Paint;

    invoke-direct {v1}, Landroid/graphics/Paint;-><init>()V

    iput-object v1, p0, Lorg/com/cctest/view/SlideSwitch;->paint:Landroid/graphics/Paint;

    .line 55
    iget-object v1, p0, Lorg/com/cctest/view/SlideSwitch;->paint:Landroid/graphics/Paint;

    invoke-virtual {v1, v3}, Landroid/graphics/Paint;->setAntiAlias(Z)V

    .line 57
    sget-object v1, Lcom/example/m6shop/R$styleable;->ExtendedListView:[I

    .line 56
    invoke-virtual {p1, p2, v1}, Landroid/content/Context;->obtainStyledAttributes(Landroid/util/AttributeSet;[I)Landroid/content/res/TypedArray;

    move-result-object v0

    .line 59
    .local v0, "a":Landroid/content/res/TypedArray;
    sget v1, Lorg/com/cctest/view/SlideSwitch;->COLOR_THEME:I

    .line 58
    invoke-virtual {v0, v4, v1}, Landroid/content/res/TypedArray;->getColor(II)I

    move-result v1

    iput v1, p0, Lorg/com/cctest/view/SlideSwitch;->color_theme:I

    .line 60
    const/4 v1, 0x4

    invoke-virtual {v0, v1, v2}, Landroid/content/res/TypedArray;->getBoolean(IZ)Z

    move-result v1

    iput-boolean v1, p0, Lorg/com/cctest/view/SlideSwitch;->isOpen:Z

    .line 61
    const/4 v1, 0x5

    invoke-virtual {v0, v1, v3}, Landroid/content/res/TypedArray;->getInt(II)I

    move-result v1

    iput v1, p0, Lorg/com/cctest/view/SlideSwitch;->shape:I

    .line 62
    invoke-virtual {v0}, Landroid/content/res/TypedArray;->recycle()V

    .line 63
    return-void
.end method

.method static synthetic access$0(Lorg/com/cctest/view/SlideSwitch;)Lorg/com/cctest/view/SlideSwitch$SlideListener;
    .locals 1

    .prologue
    .line 43
    iget-object v0, p0, Lorg/com/cctest/view/SlideSwitch;->listener:Lorg/com/cctest/view/SlideSwitch$SlideListener;

    return-object v0
.end method

.method static synthetic access$1(Lorg/com/cctest/view/SlideSwitch;)I
    .locals 1

    .prologue
    .line 37
    iget v0, p0, Lorg/com/cctest/view/SlideSwitch;->frontRect_left:I

    return v0
.end method

.method static synthetic access$2(Lorg/com/cctest/view/SlideSwitch;)I
    .locals 1

    .prologue
    .line 35
    iget v0, p0, Lorg/com/cctest/view/SlideSwitch;->max_left:I

    return v0
.end method

.method static synthetic access$3(Lorg/com/cctest/view/SlideSwitch;I)V
    .locals 0

    .prologue
    .line 34
    iput p1, p0, Lorg/com/cctest/view/SlideSwitch;->alpha:I

    return-void
.end method

.method static synthetic access$4(Lorg/com/cctest/view/SlideSwitch;)V
    .locals 0

    .prologue
    .line 191
    invoke-direct {p0}, Lorg/com/cctest/view/SlideSwitch;->invalidateView()V

    return-void
.end method

.method static synthetic access$5(Lorg/com/cctest/view/SlideSwitch;I)V
    .locals 0

    .prologue
    .line 37
    iput p1, p0, Lorg/com/cctest/view/SlideSwitch;->frontRect_left:I

    return-void
.end method

.method static synthetic access$6(Lorg/com/cctest/view/SlideSwitch;Z)V
    .locals 0

    .prologue
    .line 28
    iput-boolean p1, p0, Lorg/com/cctest/view/SlideSwitch;->isOpen:Z

    return-void
.end method

.method static synthetic access$7(Lorg/com/cctest/view/SlideSwitch;I)V
    .locals 0

    .prologue
    .line 38
    iput p1, p0, Lorg/com/cctest/view/SlideSwitch;->frontRect_left_begin:I

    return-void
.end method

.method static synthetic access$8(Lorg/com/cctest/view/SlideSwitch;)I
    .locals 1

    .prologue
    .line 36
    iget v0, p0, Lorg/com/cctest/view/SlideSwitch;->min_left:I

    return v0
.end method

.method private invalidateView()V
    .locals 2

    .prologue
    .line 192
    invoke-static {}, Landroid/os/Looper;->getMainLooper()Landroid/os/Looper;

    move-result-object v0

    invoke-static {}, Landroid/os/Looper;->myLooper()Landroid/os/Looper;

    move-result-object v1

    if-ne v0, v1, :cond_0

    .line 193
    invoke-virtual {p0}, Lorg/com/cctest/view/SlideSwitch;->invalidate()V

    .line 197
    :goto_0
    return-void

    .line 195
    :cond_0
    invoke-virtual {p0}, Lorg/com/cctest/view/SlideSwitch;->postInvalidate()V

    goto :goto_0
.end method


# virtual methods
.method public initDrawingVal()V
    .locals 6

    .prologue
    const/4 v5, 0x3

    const/4 v4, 0x0

    .line 87
    invoke-virtual {p0}, Lorg/com/cctest/view/SlideSwitch;->getMeasuredWidth()I

    move-result v1

    .line 88
    .local v1, "width":I
    invoke-virtual {p0}, Lorg/com/cctest/view/SlideSwitch;->getMeasuredHeight()I

    move-result v0

    .line 90
    .local v0, "height":I
    new-instance v2, Landroid/graphics/Rect;

    invoke-direct {v2, v4, v4, v1, v0}, Landroid/graphics/Rect;-><init>(IIII)V

    iput-object v2, p0, Lorg/com/cctest/view/SlideSwitch;->backRect:Landroid/graphics/Rect;

    .line 91
    iput v5, p0, Lorg/com/cctest/view/SlideSwitch;->min_left:I

    .line 92
    iget v2, p0, Lorg/com/cctest/view/SlideSwitch;->shape:I

    const/4 v3, 0x1

    if-ne v2, v3, :cond_0

    .line 93
    div-int/lit8 v2, v1, 0x2

    iput v2, p0, Lorg/com/cctest/view/SlideSwitch;->max_left:I

    .line 96
    :goto_0
    iget-boolean v2, p0, Lorg/com/cctest/view/SlideSwitch;->isOpen:Z

    if-eqz v2, :cond_1

    .line 97
    iget v2, p0, Lorg/com/cctest/view/SlideSwitch;->max_left:I

    iput v2, p0, Lorg/com/cctest/view/SlideSwitch;->frontRect_left:I

    .line 98
    const/16 v2, 0xff

    iput v2, p0, Lorg/com/cctest/view/SlideSwitch;->alpha:I

    .line 103
    :goto_1
    iget v2, p0, Lorg/com/cctest/view/SlideSwitch;->frontRect_left:I

    iput v2, p0, Lorg/com/cctest/view/SlideSwitch;->frontRect_left_begin:I

    .line 104
    return-void

    .line 95
    :cond_0
    add-int/lit8 v2, v0, -0x6

    sub-int v2, v1, v2

    add-int/lit8 v2, v2, -0x3

    iput v2, p0, Lorg/com/cctest/view/SlideSwitch;->max_left:I

    goto :goto_0

    .line 100
    :cond_1
    iput v5, p0, Lorg/com/cctest/view/SlideSwitch;->frontRect_left:I

    .line 101
    iput v4, p0, Lorg/com/cctest/view/SlideSwitch;->alpha:I

    goto :goto_1
.end method

.method public measureDimension(II)I
    .locals 4
    .param p1, "defaultSize"    # I
    .param p2, "measureSpec"    # I

    .prologue
    .line 108
    invoke-static {p2}, Landroid/view/View$MeasureSpec;->getMode(I)I

    move-result v1

    .line 109
    .local v1, "specMode":I
    invoke-static {p2}, Landroid/view/View$MeasureSpec;->getSize(I)I

    move-result v2

    .line 110
    .local v2, "specSize":I
    const/high16 v3, 0x40000000    # 2.0f

    if-ne v1, v3, :cond_1

    .line 111
    move v0, v2

    .line 118
    .local v0, "result":I
    :cond_0
    :goto_0
    return v0

    .line 113
    .end local v0    # "result":I
    :cond_1
    move v0, p1

    .line 114
    .restart local v0    # "result":I
    const/high16 v3, -0x80000000

    if-ne v1, v3, :cond_0

    .line 115
    invoke-static {v0, v2}, Ljava/lang/Math;->min(II)I

    move-result v0

    goto :goto_0
.end method

.method public moveToDest(Z)V
    .locals 3
    .param p1, "toRight"    # Z

    .prologue
    .line 204
    new-instance v0, Lorg/com/cctest/view/SlideSwitch$1;

    invoke-direct {v0, p0}, Lorg/com/cctest/view/SlideSwitch$1;-><init>(Lorg/com/cctest/view/SlideSwitch;)V

    .line 217
    .local v0, "handler":Landroid/os/Handler;
    new-instance v1, Ljava/lang/Thread;

    new-instance v2, Lorg/com/cctest/view/SlideSwitch$2;

    invoke-direct {v2, p0, p1, v0}, Lorg/com/cctest/view/SlideSwitch$2;-><init>(Lorg/com/cctest/view/SlideSwitch;ZLandroid/os/Handler;)V

    invoke-direct {v1, v2}, Ljava/lang/Thread;-><init>(Ljava/lang/Runnable;)V

    .line 258
    invoke-virtual {v1}, Ljava/lang/Thread;->start()V

    .line 260
    return-void
.end method

.method protected onDraw(Landroid/graphics/Canvas;)V
    .locals 8
    .param p1, "canvas"    # Landroid/graphics/Canvas;

    .prologue
    const/4 v7, 0x3

    const/4 v6, -0x1

    const v5, -0x777778

    .line 123
    iget v1, p0, Lorg/com/cctest/view/SlideSwitch;->shape:I

    const/4 v2, 0x1

    if-ne v1, v2, :cond_0

    .line 124
    iget-object v1, p0, Lorg/com/cctest/view/SlideSwitch;->paint:Landroid/graphics/Paint;

    invoke-virtual {v1, v5}, Landroid/graphics/Paint;->setColor(I)V

    .line 125
    iget-object v1, p0, Lorg/com/cctest/view/SlideSwitch;->backRect:Landroid/graphics/Rect;

    iget-object v2, p0, Lorg/com/cctest/view/SlideSwitch;->paint:Landroid/graphics/Paint;

    invoke-virtual {p1, v1, v2}, Landroid/graphics/Canvas;->drawRect(Landroid/graphics/Rect;Landroid/graphics/Paint;)V

    .line 126
    iget-object v1, p0, Lorg/com/cctest/view/SlideSwitch;->paint:Landroid/graphics/Paint;

    iget v2, p0, Lorg/com/cctest/view/SlideSwitch;->color_theme:I

    invoke-virtual {v1, v2}, Landroid/graphics/Paint;->setColor(I)V

    .line 127
    iget-object v1, p0, Lorg/com/cctest/view/SlideSwitch;->paint:Landroid/graphics/Paint;

    iget v2, p0, Lorg/com/cctest/view/SlideSwitch;->alpha:I

    invoke-virtual {v1, v2}, Landroid/graphics/Paint;->setAlpha(I)V

    .line 128
    iget-object v1, p0, Lorg/com/cctest/view/SlideSwitch;->backRect:Landroid/graphics/Rect;

    iget-object v2, p0, Lorg/com/cctest/view/SlideSwitch;->paint:Landroid/graphics/Paint;

    invoke-virtual {p1, v1, v2}, Landroid/graphics/Canvas;->drawRect(Landroid/graphics/Rect;Landroid/graphics/Paint;)V

    .line 130
    new-instance v1, Landroid/graphics/Rect;

    iget v2, p0, Lorg/com/cctest/view/SlideSwitch;->frontRect_left:I

    iget v3, p0, Lorg/com/cctest/view/SlideSwitch;->frontRect_left:I

    .line 131
    invoke-virtual {p0}, Lorg/com/cctest/view/SlideSwitch;->getMeasuredWidth()I

    move-result v4

    div-int/lit8 v4, v4, 0x2

    add-int/2addr v3, v4

    add-int/lit8 v3, v3, -0x3

    invoke-virtual {p0}, Lorg/com/cctest/view/SlideSwitch;->getMeasuredHeight()I

    move-result v4

    .line 132
    add-int/lit8 v4, v4, -0x3

    invoke-direct {v1, v2, v7, v3, v4}, Landroid/graphics/Rect;-><init>(IIII)V

    .line 130
    iput-object v1, p0, Lorg/com/cctest/view/SlideSwitch;->frontRect:Landroid/graphics/Rect;

    .line 133
    iget-object v1, p0, Lorg/com/cctest/view/SlideSwitch;->paint:Landroid/graphics/Paint;

    invoke-virtual {v1, v6}, Landroid/graphics/Paint;->setColor(I)V

    .line 134
    iget-object v1, p0, Lorg/com/cctest/view/SlideSwitch;->frontRect:Landroid/graphics/Rect;

    iget-object v2, p0, Lorg/com/cctest/view/SlideSwitch;->paint:Landroid/graphics/Paint;

    invoke-virtual {p1, v1, v2}, Landroid/graphics/Canvas;->drawRect(Landroid/graphics/Rect;Landroid/graphics/Paint;)V

    .line 150
    :goto_0
    return-void

    .line 137
    :cond_0
    iget-object v1, p0, Lorg/com/cctest/view/SlideSwitch;->backRect:Landroid/graphics/Rect;

    invoke-virtual {v1}, Landroid/graphics/Rect;->height()I

    move-result v1

    int-to-double v1, v1

    const-wide v3, 0x3ffccccccccccccdL    # 1.8

    div-double/2addr v1, v3

    double-to-int v1, v1

    add-int/lit8 v0, v1, -0x3

    .line 138
    .local v0, "radius":I
    iget-object v1, p0, Lorg/com/cctest/view/SlideSwitch;->paint:Landroid/graphics/Paint;

    invoke-virtual {v1, v5}, Landroid/graphics/Paint;->setColor(I)V

    .line 139
    new-instance v1, Landroid/graphics/RectF;

    iget-object v2, p0, Lorg/com/cctest/view/SlideSwitch;->backRect:Landroid/graphics/Rect;

    invoke-direct {v1, v2}, Landroid/graphics/RectF;-><init>(Landroid/graphics/Rect;)V

    int-to-float v2, v0

    int-to-float v3, v0

    iget-object v4, p0, Lorg/com/cctest/view/SlideSwitch;->paint:Landroid/graphics/Paint;

    invoke-virtual {p1, v1, v2, v3, v4}, Landroid/graphics/Canvas;->drawRoundRect(Landroid/graphics/RectF;FFLandroid/graphics/Paint;)V

    .line 140
    iget-object v1, p0, Lorg/com/cctest/view/SlideSwitch;->paint:Landroid/graphics/Paint;

    iget v2, p0, Lorg/com/cctest/view/SlideSwitch;->color_theme:I

    invoke-virtual {v1, v2}, Landroid/graphics/Paint;->setColor(I)V

    .line 141
    iget-object v1, p0, Lorg/com/cctest/view/SlideSwitch;->paint:Landroid/graphics/Paint;

    iget v2, p0, Lorg/com/cctest/view/SlideSwitch;->alpha:I

    invoke-virtual {v1, v2}, Landroid/graphics/Paint;->setAlpha(I)V

    .line 142
    new-instance v1, Landroid/graphics/RectF;

    iget-object v2, p0, Lorg/com/cctest/view/SlideSwitch;->backRect:Landroid/graphics/Rect;

    invoke-direct {v1, v2}, Landroid/graphics/RectF;-><init>(Landroid/graphics/Rect;)V

    int-to-float v2, v0

    int-to-float v3, v0

    iget-object v4, p0, Lorg/com/cctest/view/SlideSwitch;->paint:Landroid/graphics/Paint;

    invoke-virtual {p1, v1, v2, v3, v4}, Landroid/graphics/Canvas;->drawRoundRect(Landroid/graphics/RectF;FFLandroid/graphics/Paint;)V

    .line 144
    new-instance v1, Landroid/graphics/Rect;

    iget v2, p0, Lorg/com/cctest/view/SlideSwitch;->frontRect_left:I

    iget v3, p0, Lorg/com/cctest/view/SlideSwitch;->frontRect_left:I

    .line 145
    iget-object v4, p0, Lorg/com/cctest/view/SlideSwitch;->backRect:Landroid/graphics/Rect;

    invoke-virtual {v4}, Landroid/graphics/Rect;->height()I

    move-result v4

    add-int/2addr v3, v4

    add-int/lit8 v3, v3, -0x6

    iget-object v4, p0, Lorg/com/cctest/view/SlideSwitch;->backRect:Landroid/graphics/Rect;

    invoke-virtual {v4}, Landroid/graphics/Rect;->height()I

    move-result v4

    .line 146
    add-int/lit8 v4, v4, -0x3

    invoke-direct {v1, v2, v7, v3, v4}, Landroid/graphics/Rect;-><init>(IIII)V

    .line 144
    iput-object v1, p0, Lorg/com/cctest/view/SlideSwitch;->frontRect:Landroid/graphics/Rect;

    .line 147
    iget-object v1, p0, Lorg/com/cctest/view/SlideSwitch;->paint:Landroid/graphics/Paint;

    invoke-virtual {v1, v6}, Landroid/graphics/Paint;->setColor(I)V

    .line 148
    new-instance v1, Landroid/graphics/RectF;

    iget-object v2, p0, Lorg/com/cctest/view/SlideSwitch;->frontRect:Landroid/graphics/Rect;

    invoke-direct {v1, v2}, Landroid/graphics/RectF;-><init>(Landroid/graphics/Rect;)V

    int-to-float v2, v0

    int-to-float v3, v0

    iget-object v4, p0, Lorg/com/cctest/view/SlideSwitch;->paint:Landroid/graphics/Paint;

    invoke-virtual {p1, v1, v2, v3, v4}, Landroid/graphics/Canvas;->drawRoundRect(Landroid/graphics/RectF;FFLandroid/graphics/Paint;)V

    goto :goto_0
.end method

.method protected onMeasure(II)V
    .locals 4
    .param p1, "widthMeasureSpec"    # I
    .param p2, "heightMeasureSpec"    # I

    .prologue
    .line 75
    invoke-super {p0, p1, p2}, Landroid/view/View;->onMeasure(II)V

    .line 76
    const/16 v2, 0x118

    invoke-virtual {p0, v2, p1}, Lorg/com/cctest/view/SlideSwitch;->measureDimension(II)I

    move-result v1

    .line 77
    .local v1, "width":I
    const/16 v2, 0x8c

    invoke-virtual {p0, v2, p2}, Lorg/com/cctest/view/SlideSwitch;->measureDimension(II)I

    move-result v0

    .line 78
    .local v0, "height":I
    iget v2, p0, Lorg/com/cctest/view/SlideSwitch;->shape:I

    const/4 v3, 0x2

    if-ne v2, v3, :cond_0

    .line 79
    if-ge v1, v0, :cond_0

    .line 80
    mul-int/lit8 v1, v0, 0x2

    .line 82
    :cond_0
    invoke-virtual {p0, v1, v0}, Lorg/com/cctest/view/SlideSwitch;->setMeasuredDimension(II)V

    .line 83
    invoke-virtual {p0}, Lorg/com/cctest/view/SlideSwitch;->initDrawingVal()V

    .line 84
    return-void
.end method

.method public onTouchEvent(Landroid/view/MotionEvent;)Z
    .locals 8
    .param p1, "event"    # Landroid/view/MotionEvent;

    .prologue
    const/4 v5, 0x0

    const/4 v4, 0x1

    .line 154
    invoke-static {p1}, Landroid/support/v4/view/MotionEventCompat;->getActionMasked(Landroid/view/MotionEvent;)I

    move-result v0

    .line 156
    .local v0, "action":I
    packed-switch v0, :pswitch_data_0

    .line 185
    :cond_0
    :goto_0
    return v4

    .line 158
    :pswitch_0
    invoke-virtual {p1}, Landroid/view/MotionEvent;->getRawX()F

    move-result v5

    float-to-int v5, v5

    iput v5, p0, Lorg/com/cctest/view/SlideSwitch;->eventStartX:I

    goto :goto_0

    .line 161
    :pswitch_1
    invoke-virtual {p1}, Landroid/view/MotionEvent;->getRawX()F

    move-result v5

    float-to-int v5, v5

    iput v5, p0, Lorg/com/cctest/view/SlideSwitch;->eventLastX:I

    .line 162
    iget v5, p0, Lorg/com/cctest/view/SlideSwitch;->eventLastX:I

    iget v6, p0, Lorg/com/cctest/view/SlideSwitch;->eventStartX:I

    sub-int/2addr v5, v6

    iput v5, p0, Lorg/com/cctest/view/SlideSwitch;->diffX:I

    .line 163
    iget v5, p0, Lorg/com/cctest/view/SlideSwitch;->diffX:I

    iget v6, p0, Lorg/com/cctest/view/SlideSwitch;->frontRect_left_begin:I

    add-int v1, v5, v6

    .line 164
    .local v1, "tempX":I
    iget v5, p0, Lorg/com/cctest/view/SlideSwitch;->max_left:I

    if-le v1, v5, :cond_1

    iget v1, p0, Lorg/com/cctest/view/SlideSwitch;->max_left:I

    .line 165
    :cond_1
    iget v5, p0, Lorg/com/cctest/view/SlideSwitch;->min_left:I

    if-ge v1, v5, :cond_2

    iget v1, p0, Lorg/com/cctest/view/SlideSwitch;->min_left:I

    .line 166
    :cond_2
    iget v5, p0, Lorg/com/cctest/view/SlideSwitch;->min_left:I

    if-lt v1, v5, :cond_0

    iget v5, p0, Lorg/com/cctest/view/SlideSwitch;->max_left:I

    if-gt v1, v5, :cond_0

    .line 167
    iput v1, p0, Lorg/com/cctest/view/SlideSwitch;->frontRect_left:I

    .line 168
    const/high16 v5, 0x437f0000    # 255.0f

    int-to-float v6, v1

    mul-float/2addr v5, v6

    iget v6, p0, Lorg/com/cctest/view/SlideSwitch;->max_left:I

    int-to-float v6, v6

    div-float/2addr v5, v6

    float-to-int v5, v5

    iput v5, p0, Lorg/com/cctest/view/SlideSwitch;->alpha:I

    .line 169
    invoke-direct {p0}, Lorg/com/cctest/view/SlideSwitch;->invalidateView()V

    goto :goto_0

    .line 173
    .end local v1    # "tempX":I
    :pswitch_2
    invoke-virtual {p1}, Landroid/view/MotionEvent;->getRawX()F

    move-result v6

    iget v7, p0, Lorg/com/cctest/view/SlideSwitch;->eventStartX:I

    int-to-float v7, v7

    sub-float/2addr v6, v7

    float-to-int v3, v6

    .line 174
    .local v3, "wholeX":I
    iget v6, p0, Lorg/com/cctest/view/SlideSwitch;->frontRect_left:I

    iput v6, p0, Lorg/com/cctest/view/SlideSwitch;->frontRect_left_begin:I

    .line 176
    iget v6, p0, Lorg/com/cctest/view/SlideSwitch;->frontRect_left_begin:I

    iget v7, p0, Lorg/com/cctest/view/SlideSwitch;->max_left:I

    div-int/lit8 v7, v7, 0x2

    if-le v6, v7, :cond_4

    move v2, v4

    .line 177
    .local v2, "toRight":Z
    :goto_1
    invoke-static {v3}, Ljava/lang/Math;->abs(I)I

    move-result v6

    const/4 v7, 0x3

    if-ge v6, v7, :cond_3

    .line 178
    if-eqz v2, :cond_5

    move v2, v5

    .line 180
    :cond_3
    :goto_2
    invoke-virtual {p0, v2}, Lorg/com/cctest/view/SlideSwitch;->moveToDest(Z)V

    goto :goto_0

    .end local v2    # "toRight":Z
    :cond_4
    move v2, v5

    .line 176
    goto :goto_1

    .restart local v2    # "toRight":Z
    :cond_5
    move v2, v4

    .line 178
    goto :goto_2

    .line 156
    nop

    :pswitch_data_0
    .packed-switch 0x0
        :pswitch_0
        :pswitch_2
        :pswitch_1
    .end packed-switch
.end method

.method public setShapeType(I)V
    .locals 0
    .param p1, "shapeType"    # I

    .prologue
    .line 275
    iput p1, p0, Lorg/com/cctest/view/SlideSwitch;->shape:I

    .line 276
    return-void
.end method

.method public setSlideListener(Lorg/com/cctest/view/SlideSwitch$SlideListener;)V
    .locals 0
    .param p1, "listener"    # Lorg/com/cctest/view/SlideSwitch$SlideListener;

    .prologue
    .line 200
    iput-object p1, p0, Lorg/com/cctest/view/SlideSwitch;->listener:Lorg/com/cctest/view/SlideSwitch$SlideListener;

    .line 201
    return-void
.end method

.method public setState(Z)V
    .locals 1
    .param p1, "isOpen"    # Z

    .prologue
    .line 263
    iput-boolean p1, p0, Lorg/com/cctest/view/SlideSwitch;->isOpen:Z

    .line 264
    invoke-virtual {p0}, Lorg/com/cctest/view/SlideSwitch;->initDrawingVal()V

    .line 265
    invoke-direct {p0}, Lorg/com/cctest/view/SlideSwitch;->invalidateView()V

    .line 266
    iget-object v0, p0, Lorg/com/cctest/view/SlideSwitch;->listener:Lorg/com/cctest/view/SlideSwitch$SlideListener;

    if-eqz v0, :cond_0

    .line 267
    if-eqz p1, :cond_1

    .line 268
    iget-object v0, p0, Lorg/com/cctest/view/SlideSwitch;->listener:Lorg/com/cctest/view/SlideSwitch$SlideListener;

    invoke-interface {v0}, Lorg/com/cctest/view/SlideSwitch$SlideListener;->open()V

    .line 272
    :cond_0
    :goto_0
    return-void

    .line 270
    :cond_1
    iget-object v0, p0, Lorg/com/cctest/view/SlideSwitch;->listener:Lorg/com/cctest/view/SlideSwitch$SlideListener;

    invoke-interface {v0}, Lorg/com/cctest/view/SlideSwitch$SlideListener;->close()V

    goto :goto_0
.end method
